<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Cheetah Software: utilities.h File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Cheetah Software
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
      <li><a href="../../globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('de/df0/utilities_8h.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">utilities.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;algorithm&gt;</code><br />
<code>#include &lt;map&gt;</code><br />
<code>#include &lt;random&gt;</code><br />
<code>#include &lt;unordered_map&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &quot;<a class="el" href="../../d9/d8e/cpp_types_8h_source.html">cppTypes.h</a>&quot;</code><br />
</div><div class="textblock"><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Include dependency graph for utilities.h:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/dfc/utilities_8h__incl.png" border="0" usemap="#utilities_8h" alt=""/></div>
<map name="utilities_8h" id="utilities_8h">
</map>
</div>
</div><div class="textblock"><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> This graph shows which files directly or indirectly include this file:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d0/db7/utilities_8h__dep__incl.png" border="0" usemap="#utilities_8hdep" alt=""/></div>
<map name="utilities_8hdep" id="utilities_8hdep">
</map>
</div>
</div>
<p><a href="../../de/df0/utilities_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a16ea9aab4737c2622bc370d6a8613d63"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a16ea9aab4737c2622bc370d6a8613d63"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a16ea9aab4737c2622bc370d6a8613d63">fpEqual</a> (T a, T b, T tol)</td></tr>
<tr class="separator:a16ea9aab4737c2622bc370d6a8613d63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42a85233a23e8e7af211cb76f5fce9ee"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a42a85233a23e8e7af211cb76f5fce9ee"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a42a85233a23e8e7af211cb76f5fce9ee">vectorEqual</a> (const std::vector&lt; T &gt; &amp;a, const std::vector&lt; T &gt; &amp;b)</td></tr>
<tr class="separator:a42a85233a23e8e7af211cb76f5fce9ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0aa540668aefb3f931f06b9af3b7098c"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a0aa540668aefb3f931f06b9af3b7098c"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a0aa540668aefb3f931f06b9af3b7098c">coerce</a> (T in, T min, T max)</td></tr>
<tr class="separator:a0aa540668aefb3f931f06b9af3b7098c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ecabd546948cea7bb3c432258a1b2ac"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a2ecabd546948cea7bb3c432258a1b2ac"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a2ecabd546948cea7bb3c432258a1b2ac">deadband</a> (T x, T range)</td></tr>
<tr class="separator:a2ecabd546948cea7bb3c432258a1b2ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3f93eed76d65a061a54d0b0b46db70a"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ae3f93eed76d65a061a54d0b0b46db70a"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#ae3f93eed76d65a061a54d0b0b46db70a">eigenDeadband</a> (Eigen::MatrixBase&lt; T &gt; &amp;v, typename T::Scalar band)</td></tr>
<tr class="separator:ae3f93eed76d65a061a54d0b0b46db70a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ab31b90bc584c635ec159468ceed9b2"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a1ab31b90bc584c635ec159468ceed9b2"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a1ab31b90bc584c635ec159468ceed9b2">sgn</a> (T val)</td></tr>
<tr class="separator:a1ab31b90bc584c635ec159468ceed9b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbe68d910024077560aa4d2c88c9ca76"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:abbe68d910024077560aa4d2c88c9ca76"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#abbe68d910024077560aa4d2c88c9ca76">fillEigenWithRandom</a> (Eigen::MatrixBase&lt; T &gt; &amp;v, std::mt19937 &amp;gen, std::uniform_real_distribution&lt; typename T::Scalar &gt; &amp;dist)</td></tr>
<tr class="separator:abbe68d910024077560aa4d2c88c9ca76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a58ce05a0a613ad84ef27f761d959f6"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a4a58ce05a0a613ad84ef27f761d959f6"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a4a58ce05a0a613ad84ef27f761d959f6">generator_gaussian_noise</a> (T mean, T var)</td></tr>
<tr class="separator:a4a58ce05a0a613ad84ef27f761d959f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a903d24212203968fe69a10dbcdb4a950"><td class="memTemplParams" colspan="2">template&lt;typename T1 , typename T2 &gt; </td></tr>
<tr class="memitem:a903d24212203968fe69a10dbcdb4a950"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a903d24212203968fe69a10dbcdb4a950">uMapContains</a> (const std::unordered_map&lt; T1, T2 &gt; &amp;set, T1 key)</td></tr>
<tr class="separator:a903d24212203968fe69a10dbcdb4a950"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ee36d7e1f86b7307f0e0aef157237a7"><td class="memTemplParams" colspan="2">template&lt;typename T1 , typename T2 &gt; </td></tr>
<tr class="memitem:a8ee36d7e1f86b7307f0e0aef157237a7"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a8ee36d7e1f86b7307f0e0aef157237a7">mapContains</a> (const std::map&lt; T1, T2 &gt; &amp;set, T1 key)</td></tr>
<tr class="separator:a8ee36d7e1f86b7307f0e0aef157237a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb4bfd4bd21d2af1b655d5039281ec3b"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:acb4bfd4bd21d2af1b655d5039281ec3b"><td class="memTemplItemLeft" align="right" valign="top">std::string&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#acb4bfd4bd21d2af1b655d5039281ec3b">numberToString</a> (T number)</td></tr>
<tr class="separator:acb4bfd4bd21d2af1b655d5039281ec3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a127a473fa496483dcfa8e843999d2741"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a127a473fa496483dcfa8e843999d2741"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a127a473fa496483dcfa8e843999d2741">mapToRange</a> (T x, T inputMin, T inputMax, T outputMin, T outputMax)</td></tr>
<tr class="separator:a127a473fa496483dcfa8e843999d2741"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55ba169f0a864570abe97adfe4dbf540"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a55ba169f0a864570abe97adfe4dbf540"><td class="memTemplItemLeft" align="right" valign="top">std::string&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a55ba169f0a864570abe97adfe4dbf540">eigenToString</a> (Eigen::MatrixBase&lt; T &gt; &amp;value)</td></tr>
<tr class="separator:a55ba169f0a864570abe97adfe4dbf540"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9a56a1d607c196f5e27de8125583c6a"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#ae9a56a1d607c196f5e27de8125583c6a">boolToString</a> (bool b)</td></tr>
<tr class="separator:ae9a56a1d607c196f5e27de8125583c6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12c9857847f253886a46da7b5c32dbc6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a12c9857847f253886a46da7b5c32dbc6">writeStringToFile</a> (const std::string &amp;fileName, const std::string &amp;fileData)</td></tr>
<tr class="separator:a12c9857847f253886a46da7b5c32dbc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a287878cb2b4807ea103f0bbea0b896bc"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a287878cb2b4807ea103f0bbea0b896bc">getCurrentTimeAndDate</a> ()</td></tr>
<tr class="separator:a287878cb2b4807ea103f0bbea0b896bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe1bbec53e0ac370224c4aa5c3433b0e"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#afe1bbec53e0ac370224c4aa5c3433b0e">getConfigDirectoryPath</a> ()</td></tr>
<tr class="separator:afe1bbec53e0ac370224c4aa5c3433b0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5030ebabfff041e947bbf290ea294800"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a5030ebabfff041e947bbf290ea294800"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a5030ebabfff041e947bbf290ea294800">EulerZYX_2_SO3</a> (const <a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt; &amp;euler_zyx, <a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt; T &gt; &amp;SO3)</td></tr>
<tr class="separator:a5030ebabfff041e947bbf290ea294800"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7b8ad0e1d330d233fd5080d3846fdac"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ac7b8ad0e1d330d233fd5080d3846fdac"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#ac7b8ad0e1d330d233fd5080d3846fdac">smooth_change</a> (T ini, T end, T moving_duration, T curr_time)</td></tr>
<tr class="separator:ac7b8ad0e1d330d233fd5080d3846fdac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa4832258a624775b1780fc7e36fb574"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:aaa4832258a624775b1780fc7e36fb574"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#aaa4832258a624775b1780fc7e36fb574">smooth_change_vel</a> (T ini, T end, T moving_duration, T curr_time)</td></tr>
<tr class="separator:aaa4832258a624775b1780fc7e36fb574"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f8f6b7789c59c9b0d0fc1eb25fb8758"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a4f8f6b7789c59c9b0d0fc1eb25fb8758"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a4f8f6b7789c59c9b0d0fc1eb25fb8758">smooth_change_acc</a> (T ini, T end, T moving_duration, T curr_time)</td></tr>
<tr class="separator:a4f8f6b7789c59c9b0d0fc1eb25fb8758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad97ad90ed11025262d42c71962a1da85"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ad97ad90ed11025262d42c71962a1da85"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#ad97ad90ed11025262d42c71962a1da85">stringToNumber</a> (const std::string &amp;str)</td></tr>
<tr class="separator:ad97ad90ed11025262d42c71962a1da85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56c19e67ab316b5de1b2759866c3c9e6"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a56c19e67ab316b5de1b2759866c3c9e6"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a56c19e67ab316b5de1b2759866c3c9e6">stringToNumber</a> (const char *str)</td></tr>
<tr class="separator:a56c19e67ab316b5de1b2759866c3c9e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38a32f4265a57865e58d7e7bac196cc2"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a38a32f4265a57865e58d7e7bac196cc2"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#a38a32f4265a57865e58d7e7bac196cc2">stringToVec3</a> (const std::string &amp;str)</td></tr>
<tr class="separator:a38a32f4265a57865e58d7e7bac196cc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3945f023f4c554ec5670ac03ff82525"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/df0/utilities_8h.html#aa3945f023f4c554ec5670ac03ff82525">getLcmUrl</a> (<a class="el" href="../../d0/d99/c_types_8h.html#a350c6fc928e3bdc6c6486268ac8fb269">s64</a> ttl)</td></tr>
<tr class="separator:aa3945f023f4c554ec5670ac03ff82525"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ae9a56a1d607c196f5e27de8125583c6a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static std::string boolToString </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00154">154</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>

<p>References <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00030">getConfigDirectoryPath()</a>, <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00018">getCurrentTimeAndDate()</a>, and <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00007">writeStringToFile()</a>.</p>
<div class="fragment"><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                                             {</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="keywordflow">return</span> std::string(b ? <span class="stringliteral">&quot;true&quot;</span> : <span class="stringliteral">&quot;false&quot;</span>);</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-2" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-2-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-2-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-2-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_cgraph.png" border="0" usemap="#de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_cgraph" alt=""/></div>
<map name="de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_cgraph" id="de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_cgraph">
</map>
</div>
</p>

<p><div id="dynsection-3" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-3-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-3-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-3-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_icgraph.png" border="0" usemap="#de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_icgraph" id="de/df0/utilities_8h_ae9a56a1d607c196f5e27de8125583c6a_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a0aa540668aefb3f931f06b9af3b7098c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T coerce </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>max</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Coerce in to be between min and max </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00035">35</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;                             {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  <span class="keywordflow">if</span> (in &lt; min) {</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    in = min;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  }</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  <span class="keywordflow">if</span> (in &gt; max) {</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    in = max;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  }</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;  <span class="keywordflow">return</span> in;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-4" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-4-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-4-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-4-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a0aa540668aefb3f931f06b9af3b7098c_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a0aa540668aefb3f931f06b9af3b7098c_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a0aa540668aefb3f931f06b9af3b7098c_icgraph" id="de/df0/utilities_8h_a0aa540668aefb3f931f06b9af3b7098c_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a2ecabd546948cea7bb3c432258a1b2ac"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T deadband </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>range</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00046">46</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                         {</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  <span class="keywordflow">if</span> (x &lt; range &amp;&amp; x &gt; -range) x = T(0);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <span class="keywordflow">return</span> x;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-5" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-5-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-5-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-5-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a2ecabd546948cea7bb3c432258a1b2ac_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a2ecabd546948cea7bb3c432258a1b2ac_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a2ecabd546948cea7bb3c432258a1b2ac_icgraph" id="de/df0/utilities_8h_a2ecabd546948cea7bb3c432258a1b2ac_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ae3f93eed76d65a061a54d0b0b46db70a"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void eigenDeadband </td>
          <td>(</td>
          <td class="paramtype">Eigen::MatrixBase&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename T::Scalar&#160;</td>
          <td class="paramname"><em>band</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00052">52</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>

<p>References <a class="el" href="../../de/df0/utilities_8h_source.html#l00046">deadband()</a>.</p>
<div class="fragment"><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;                                                                 {</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; T::RowsAtCompileTime; i++) {</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j &lt; T::ColsAtCompileTime; j++) {</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;      v(i, j) = <a class="code" href="../../de/df0/utilities_8h.html#a2ecabd546948cea7bb3c432258a1b2ac">deadband</a>(v(i, j), band);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    }</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  }</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;}</div><div class="ttc" id="utilities_8h_html_a2ecabd546948cea7bb3c432258a1b2ac"><div class="ttname"><a href="../../de/df0/utilities_8h.html#a2ecabd546948cea7bb3c432258a1b2ac">deadband</a></div><div class="ttdeci">T deadband(T x, T range)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/df0/utilities_8h_source.html#l00046">utilities.h:46</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-6" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-6-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-6-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-6-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_cgraph.png" border="0" usemap="#de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_cgraph" alt=""/></div>
<map name="de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_cgraph" id="de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_cgraph">
</map>
</div>
</p>

<p><div id="dynsection-7" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-7-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-7-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-7-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_icgraph.png" border="0" usemap="#de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_icgraph" id="de/df0/utilities_8h_ae3f93eed76d65a061a54d0b0b46db70a_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a55ba169f0a864570abe97adfe4dbf540"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::string eigenToString </td>
          <td>(</td>
          <td class="paramtype">Eigen::MatrixBase&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00148">148</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;                                                   {</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;  std::stringstream ss;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  ss &lt;&lt; value;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  <span class="keywordflow">return</span> ss.str();</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-8" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-8-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-8-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-8-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a55ba169f0a864570abe97adfe4dbf540_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a55ba169f0a864570abe97adfe4dbf540_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a55ba169f0a864570abe97adfe4dbf540_icgraph" id="de/df0/utilities_8h_a55ba169f0a864570abe97adfe4dbf540_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a5030ebabfff041e947bbf290ea294800"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void EulerZYX_2_SO3 </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>euler_zyx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>SO3</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the rotation matrix coincide with euler angle Intrisic ZYX rotation </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00168">168</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;                                                            {</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;T&gt;</a> Mat3_Z, Mat3_Y, Mat3_X;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  Mat3_Z &lt;&lt; cos(euler_zyx[0]), -sin(euler_zyx[0]), 0, sin(euler_zyx[0]),</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;      cos(euler_zyx[0]), 0, 0, 0, 1;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  Mat3_Y &lt;&lt; cos(euler_zyx[1]), 0, sin(euler_zyx[1]), 0, 1, 0,</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      -sin(euler_zyx[1]), 0, cos(euler_zyx[1]);</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;  Mat3_X &lt;&lt; 1, 0, 0, 0, cos(euler_zyx[2]), -sin(euler_zyx[2]), 0,</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;      sin(euler_zyx[2]), cos(euler_zyx[2]);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  SO3 = Mat3_Z * Mat3_Y * Mat3_X;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;}</div><div class="ttc" id="cpp_types_8h_html_aa8cb424e643d476ea485238dad7c3e18"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 3 &gt; Mat3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00054">cppTypes.h:54</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="abbe68d910024077560aa4d2c88c9ca76"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void fillEigenWithRandom </td>
          <td>(</td>
          <td class="paramtype">Eigen::MatrixBase&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::mt19937 &amp;&#160;</td>
          <td class="paramname"><em>gen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uniform_real_distribution&lt; typename T::Scalar &gt; &amp;&#160;</td>
          <td class="paramname"><em>dist</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Fill an eigen type with random numbers from a random generator and uniform real distribution. TODO: is there a way to make this work nicely with normal distributions too? </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00075">75</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                                                          {</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; T::RowsAtCompileTime; i++) {</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = 0; j &lt; T::ColsAtCompileTime; j++) {</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;      v(i, j) = dist(gen);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-9" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-9-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-9-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-9-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_abbe68d910024077560aa4d2c88c9ca76_icgraph.png" border="0" usemap="#de/df0/utilities_8h_abbe68d910024077560aa4d2c88c9ca76_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_abbe68d910024077560aa4d2c88c9ca76_icgraph" id="de/df0/utilities_8h_abbe68d910024077560aa4d2c88c9ca76_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a16ea9aab4737c2622bc370d6a8613d63"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool fpEqual </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>tol</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Are two floating point values almost equal? </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00015">15</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;                              {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;  <span class="keywordflow">return</span> std::abs(a - b) &lt;= tol;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-10" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-10-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-10-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-10-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a16ea9aab4737c2622bc370d6a8613d63_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a16ea9aab4737c2622bc370d6a8613d63_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a16ea9aab4737c2622bc370d6a8613d63_icgraph" id="de/df0/utilities_8h_a16ea9aab4737c2622bc370d6a8613d63_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a4a58ce05a0a613ad84ef27f761d959f6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T generator_gaussian_noise </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>mean</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>var</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate a random number following normal distribution </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00089">89</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;                                          {</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">bool</span> hasSpare = <span class="keyword">false</span>;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  <span class="keyword">static</span> T rand1, rand2;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="keywordflow">if</span> (hasSpare) {</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    hasSpare = <span class="keyword">false</span>;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordflow">return</span> mean + sqrt(var * rand1) * sin(rand2);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  }</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  hasSpare = <span class="keyword">true</span>;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  rand1 = rand() / ((T)RAND_MAX);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  <span class="keywordflow">if</span> (rand1 &lt; 1e-100) rand1 = 1e-100;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  rand1 = -2 * log(rand1);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  rand2 = rand() / ((T)RAND_MAX) * M_PI * 2.;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  <span class="comment">// printf(&quot;rand: %f, %f\n&quot;, rand1, rand2);</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keywordflow">return</span> mean + sqrt(var * rand1) * cos(rand2);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="afe1bbec53e0ac370224c4aa5c3433b0e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string getConfigDirectoryPath </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Todo: do something better to keep track of where we are relative to the config directory </p>

<p>Definition at line <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00030">30</a> of file <a class="el" href="../../de/da5/utilities_8cpp_source.html">utilities.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;{ <span class="keywordflow">return</span> <span class="stringliteral">&quot;../config/&quot;</span>; }</div></div><!-- fragment -->
<p><div id="dynsection-11" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-11-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-11-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-11-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_afe1bbec53e0ac370224c4aa5c3433b0e_icgraph.png" border="0" usemap="#de/df0/utilities_8h_afe1bbec53e0ac370224c4aa5c3433b0e_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_afe1bbec53e0ac370224c4aa5c3433b0e_icgraph" id="de/df0/utilities_8h_afe1bbec53e0ac370224c4aa5c3433b0e_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a287878cb2b4807ea103f0bbea0b896bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string getCurrentTimeAndDate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00018">18</a> of file <a class="el" href="../../de/da5/utilities_8cpp_source.html">utilities.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;                                  {</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  <span class="keyword">auto</span> t = std::time(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  <span class="keyword">auto</span> tm = *std::localtime(&amp;t);</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;  std::ostringstream ss;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;  ss &lt;&lt; std::put_time(&amp;tm, <span class="stringliteral">&quot;%c&quot;</span>);</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;  <span class="keywordflow">return</span> ss.str();</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-12" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-12-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-12-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-12-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a287878cb2b4807ea103f0bbea0b896bc_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a287878cb2b4807ea103f0bbea0b896bc_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a287878cb2b4807ea103f0bbea0b896bc_icgraph" id="de/df0/utilities_8h_a287878cb2b4807ea103f0bbea0b896bc_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="aa3945f023f4c554ec5670ac03ff82525"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string getLcmUrl </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/d99/c_types_8h.html#a350c6fc928e3bdc6c6486268ac8fb269">s64</a>&#160;</td>
          <td class="paramname"><em>ttl</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00032">32</a> of file <a class="el" href="../../de/da5/utilities_8cpp_source.html">utilities.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;                             {</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;  assert(ttl &gt;= 0 &amp;&amp; ttl &lt;= 255);</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;  <span class="keywordflow">return</span> <span class="stringliteral">&quot;udpm://239.255.76.67:7667?ttl=&quot;</span> + std::to_string(ttl);</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;}</div><!-- fragment -->
<p><div id="dynsection-13" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-13-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-13-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-13-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_aa3945f023f4c554ec5670ac03ff82525_icgraph.png" border="0" usemap="#de/df0/utilities_8h_aa3945f023f4c554ec5670ac03ff82525_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_aa3945f023f4c554ec5670ac03ff82525_icgraph" id="de/df0/utilities_8h_aa3945f023f4c554ec5670ac03ff82525_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a8ee36d7e1f86b7307f0e0aef157237a7"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T1 , typename T2 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool mapContains </td>
          <td>(</td>
          <td class="paramtype">const std::map&lt; T1, T2 &gt; &amp;&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T1&#160;</td>
          <td class="paramname"><em>key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Does the unordered map contain the given element? </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00120">120</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                                                    {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <span class="keywordflow">return</span> <span class="keyword">set</span>.find(key) != <span class="keyword">set</span>.end();</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-14" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-14-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-14-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-14-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a8ee36d7e1f86b7307f0e0aef157237a7_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a8ee36d7e1f86b7307f0e0aef157237a7_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a8ee36d7e1f86b7307f0e0aef157237a7_icgraph" id="de/df0/utilities_8h_a8ee36d7e1f86b7307f0e0aef157237a7_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a127a473fa496483dcfa8e843999d2741"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T mapToRange </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>inputMin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>inputMax</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>outputMin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>outputMax</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>map value x in (inputMin, inputMax) to (outputMin, outputMax) </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00142">142</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                                                                    {</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  <span class="keywordflow">return</span> outputMin +</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;         (x - inputMin) * (outputMax - outputMin) / (inputMax - inputMin);</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-15" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-15-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-15-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-15-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a127a473fa496483dcfa8e843999d2741_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a127a473fa496483dcfa8e843999d2741_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a127a473fa496483dcfa8e843999d2741_icgraph" id="de/df0/utilities_8h_a127a473fa496483dcfa8e843999d2741_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="acb4bfd4bd21d2af1b655d5039281ec3b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::string numberToString </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>number</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Convert a floating point number to a string. Is preferable over std::to_string because this uses scientific notation and won't truncate small/large numbers. </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00130">130</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                                   {</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  static_assert(std::is_floating_point&lt;T&gt;::value,</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                <span class="stringliteral">&quot;numberToString must use a floating point type!&quot;</span>);</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;  <span class="keywordtype">char</span> buffer[100];</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  sprintf(buffer, <span class="stringliteral">&quot;%g&quot;</span>, number);</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  <span class="keywordflow">return</span> std::string(buffer);</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-16" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-16-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-16-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-16-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_acb4bfd4bd21d2af1b655d5039281ec3b_icgraph.png" border="0" usemap="#de/df0/utilities_8h_acb4bfd4bd21d2af1b655d5039281ec3b_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_acb4bfd4bd21d2af1b655d5039281ec3b_icgraph" id="de/df0/utilities_8h_acb4bfd4bd21d2af1b655d5039281ec3b_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a1ab31b90bc584c635ec159468ceed9b2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">int sgn </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>val</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the sign of a number 1 for positive, 0 for 0, -1 for negative... </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00065">65</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;               {</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <span class="keywordflow">return</span> (T(0) &lt; val) - (val &lt; T(0));</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-17" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-17-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-17-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-17-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a1ab31b90bc584c635ec159468ceed9b2_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a1ab31b90bc584c635ec159468ceed9b2_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a1ab31b90bc584c635ec159468ceed9b2_icgraph" id="de/df0/utilities_8h_a1ab31b90bc584c635ec159468ceed9b2_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ac7b8ad0e1d330d233fd5080d3846fdac"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T smooth_change </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>ini</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>moving_duration</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>curr_time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00182">182</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;                                                              {</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  <span class="keywordflow">if</span> (curr_time &gt; moving_duration) {</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">return</span> end;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  }</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  <span class="keywordflow">return</span> (ini +</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;          (end - ini) * 0.5 * (1 - cos(curr_time / moving_duration * M_PI)));</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a4f8f6b7789c59c9b0d0fc1eb25fb8758"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T smooth_change_acc </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>ini</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>moving_duration</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>curr_time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00200">200</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;                                                                  {</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;  <span class="keywordflow">if</span> (curr_time &gt; moving_duration) {</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="keywordflow">return</span> 0.0;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;  }</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="keywordflow">return</span> ((end - ini) * 0.5 * (M_PI / moving_duration) *</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;          (M_PI / moving_duration) * cos(curr_time / moving_duration * M_PI));</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="aaa4832258a624775b1780fc7e36fb574"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T smooth_change_vel </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>ini</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>moving_duration</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>curr_time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00191">191</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                                                                  {</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;  <span class="keywordflow">if</span> (curr_time &gt; moving_duration) {</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keywordflow">return</span> 0.0;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  }</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  <span class="keywordflow">return</span> ((end - ini) * 0.5 * (M_PI / moving_duration) *</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;          sin(curr_time / moving_duration * M_PI));</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ad97ad90ed11025262d42c71962a1da85"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T stringToNumber </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00209">209</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;                                       {</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  static_assert(std::is_same&lt;T, double&gt;::value || std::is_same&lt;T, float&gt;::value,</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;                <span class="stringliteral">&quot;stringToNumber only works for double/float&quot;</span>);</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;  <span class="keywordflow">if</span> (std::is_same&lt;T, double&gt;::value) {</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <span class="keywordflow">return</span> std::stod(str);</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (std::is_same&lt;T, float&gt;::value) {</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <span class="keywordflow">return</span> std::stof(str);</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;  }</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a56c19e67ab316b5de1b2759866c3c9e6"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T stringToNumber </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00221">221</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;                                  {</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;  <span class="keywordflow">return</span> stringToNumber&lt;T&gt;(std::string(str));</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a38a32f4265a57865e58d7e7bac196cc2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a>&lt;T&gt; stringToVec3 </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00226">226</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>

<p>References <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00032">getLcmUrl()</a>.</p>
<div class="fragment"><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;                                           {</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;T&gt;</a> v;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  <span class="keywordtype">size_t</span> i = 0;</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  <span class="comment">// seek past whitespace</span></div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;  <span class="keywordflow">if</span> (str.at(i) == <span class="charliteral">&#39;[&#39;</span>) {</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    i++;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;stringToVec3 didn&#39;t find open bracket&quot;</span>);</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;  }</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;  <span class="comment">// seek past whitespace</span></div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;  <span class="keywordtype">size_t</span> start = i;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;  <span class="comment">// seek to end of first number</span></div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  <span class="keywordflow">while</span> (str.at(i) != <span class="charliteral">&#39;,&#39;</span>) i++;</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  v[0] = stringToNumber&lt;T&gt;(str.substr(start, i - start));</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  i++;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;  start = i;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;  <span class="keywordflow">while</span> (str.at(i) != <span class="charliteral">&#39;,&#39;</span>) i++;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  v[1] = stringToNumber&lt;T&gt;(str.substr(start, i - start));</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;  i++;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;  <span class="keywordflow">while</span> (str.at(i) == <span class="charliteral">&#39; &#39;</span>) i++;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  start = i;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;  <span class="keywordflow">while</span> (str.at(i) != <span class="charliteral">&#39;]&#39;</span>) i++;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;  v[2] = stringToNumber&lt;T&gt;(str.substr(start, i - start));</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;  <span class="keywordflow">return</span> v;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;}</div><div class="ttc" id="cpp_types_8h_html_a6f07728c866b15ff0676a9b2ebfd2ba6"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 1 &gt; Vec3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00026">cppTypes.h:26</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-18" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-18-trigger" src="../../closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-18-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-18-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a38a32f4265a57865e58d7e7bac196cc2_cgraph.png" border="0" usemap="#de/df0/utilities_8h_a38a32f4265a57865e58d7e7bac196cc2_cgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a38a32f4265a57865e58d7e7bac196cc2_cgraph" id="de/df0/utilities_8h_a38a32f4265a57865e58d7e7bac196cc2_cgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a903d24212203968fe69a10dbcdb4a950"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T1 , typename T2 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool uMapContains </td>
          <td>(</td>
          <td class="paramtype">const std::unordered_map&lt; T1, T2 &gt; &amp;&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T1&#160;</td>
          <td class="paramname"><em>key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Does the unordered map contain the given element? </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00112">112</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                                                               {</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  <span class="keywordflow">return</span> <span class="keyword">set</span>.find(key) != <span class="keyword">set</span>.end();</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-19" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-19-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-19-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-19-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a903d24212203968fe69a10dbcdb4a950_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a903d24212203968fe69a10dbcdb4a950_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a903d24212203968fe69a10dbcdb4a950_icgraph" id="de/df0/utilities_8h_a903d24212203968fe69a10dbcdb4a950_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a42a85233a23e8e7af211cb76f5fce9ee"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool vectorEqual </td>
          <td>(</td>
          <td class="paramtype">const std::vector&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Are two std::vectors equal? </p>

<p>Definition at line <a class="el" href="../../de/df0/utilities_8h_source.html#l00023">23</a> of file <a class="el" href="../../de/df0/utilities_8h_source.html">utilities.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;                                                               {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  <span class="keywordflow">if</span> (a.size() != b.size()) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; a.size(); i++) {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keywordflow">if</span> (a[i] != b[i]) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  }</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-20" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-20-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-20-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-20-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a42a85233a23e8e7af211cb76f5fce9ee_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a42a85233a23e8e7af211cb76f5fce9ee_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a42a85233a23e8e7af211cb76f5fce9ee_icgraph" id="de/df0/utilities_8h_a42a85233a23e8e7af211cb76f5fce9ee_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a12c9857847f253886a46da7b5c32dbc6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void writeStringToFile </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>fileName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>fileData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../de/da5/utilities_8cpp_source.html#l00007">7</a> of file <a class="el" href="../../de/da5/utilities_8cpp_source.html">utilities.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;                                                  {</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;  FILE* fp = fopen(fileName.c_str(), <span class="stringliteral">&quot;w&quot;</span>);</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;  <span class="keywordflow">if</span> (!fp) {</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    printf(<span class="stringliteral">&quot;Failed to fopen %s\n&quot;</span>, fileName.c_str());</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;    <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;Failed to open file&quot;</span>);</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;  }</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;  fprintf(fp, <span class="stringliteral">&quot;%s&quot;</span>, fileData.c_str());</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;  fclose(fp);</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;}</div></div><!-- fragment -->
<p><div id="dynsection-21" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-21-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-21-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-21-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../de/df0/utilities_8h_a12c9857847f253886a46da7b5c32dbc6_icgraph.png" border="0" usemap="#de/df0/utilities_8h_a12c9857847f253886a46da7b5c32dbc6_icgraph" alt=""/></div>
<map name="de/df0/utilities_8h_a12c9857847f253886a46da7b5c32dbc6_icgraph" id="de/df0/utilities_8h_a12c9857847f253886a46da7b5c32dbc6_icgraph">
</map>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.html">home</a></li><li class="navelem"><a class="el" href="../../dir_61bfb0b3cdda81b1b0355ba34eb3b1eb.html">dhkim</a></li><li class="navelem"><a class="el" href="../../dir_adee5b101e079090017bb4e91c628ead.html">Public_Repository</a></li><li class="navelem"><a class="el" href="../../dir_7fc07a7b97001e7b1d18e11da761e2de.html">Cheetah-Software</a></li><li class="navelem"><a class="el" href="../../dir_860379c26524a894b3cf97b5b1ba5bdb.html">common</a></li><li class="navelem"><a class="el" href="../../dir_275ce76ae8a9e2090fbb7142d3994a0e.html">include</a></li><li class="navelem"><a class="el" href="../../dir_d631aa3083290dc23dd8bdcd7ad213ec.html">Utilities</a></li><li class="navelem"><a class="el" href="../../de/df0/utilities_8h.html">utilities.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
